#include<iostream>
using namespace std;
int main()
{
	int a,b;
	int k=1;
	int ans=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		printf("%5d",i);
		k++;
		ans+=i;
		if(k==6)
		{
			cout<<endl;
		    k=1;
		}
	}
	if(k!=1)
	cout<<endl;
	cout<<"Sum = "<<ans<<endl;
	return 0;
}
